# ============================================================================
#
# syshandler.s
#
# ============================================================================

.file "x86/syshandler.s"

.text

# The commented out lines with .type, .func and .endfunc are used on linux
# Please do not remove them. See Makefile rule for .s.o for how they are enabled
	
  # The goto_real wrapper uses a special hook to get simulator to invoke
  # the internal version.  Doing things like this means we are safe from
  # caller-saved regs, as opposed to inline assembly.
#gas2 #ifdef __linux__
#gas2 .type goto_real,"function"
#gas2 #endif
#gas2 .func goto_real
.globl goto_real
.globl _goto_real
_goto_real:
goto_real:
  # this movl/int sequenence is invoking ISA_EXT_GOTO_REAL
  # this will be *simulated*
  movl $386, %eax
  int $0x0
  # this return will resume program after goto_real
  # this will *not* be simulated
  ret
#gas2 .endfunc
	
  # The goto_sim is in 100% assembly. Doing this means we are safe from
  # caller-saved regs, as opposed to inline assembly.
#gas2 #ifdef __linux__
#gas2 .type goto_sim,"function"
#gas2 #endif
#gas2 .func goto_sim
.globl goto_sim
.globl _goto_sim
_goto_sim:
goto_sim:
  jmp MY_RESUME_FROM_REAL_LABEL
#gas2 .endfunc

